package com.zkingsoft.actions.admin;

import com.zkingsoft.services.MeetingContentService;

import javax.annotation.Resource;

import com.zkingsoft.actions.common.BaseController;

import org.springframework.stereotype.Controller;

import com.zkingsoft.pojo.AjaxResult;
import com.zkingsoft.plugin.pojo.PaginationVO;
import com.zkingsoft.plugin.util.WebUtil;

import org.springframework.web.bind.annotation.ResponseBody;

import com.zkingsoft.model.MeetingContent;

import org.springframework.web.bind.annotation.RequestMapping;

import com.zkingsoft.anotations.RemoveRequestToken;
import com.zkingsoft.anotations.SaveRequestToken;

/**
 * This field was generated by Zking.software.Codegen.
 * @date 2016-11-24 14:24
 */
@Controller
@RequestMapping(value = "admin/meetingContent")
public class MeetingContentController extends BaseController{

	@Resource
	private MeetingContentService currentService;
	
	/**
	 * 列表显示
	 */
	@RequestMapping(value = "/showList")
	public @ResponseBody AjaxResult showList(MeetingContent meetingContent, PaginationVO pageVo) {
		return showList(currentService, meetingContent, pageVo);
	}
   	
	/**
	 * 新增或者修改页面
	 */   
	@RemoveRequestToken	
   	@RequestMapping(value = "/addOrModify")
	public @ResponseBody AjaxResult addOrModify(MeetingContent meetingContent) {
		if (meetingContent.getId() != null) {
			return modify(currentService, meetingContent, "要点反馈");
		} else {
			return add(currentService, meetingContent, "要点反馈");
		}
	}
	
   	/**
	 * 进入修改界面
	 */   
	@SaveRequestToken
   	@RequestMapping(value = "/editForm")
	public String editForm(Long id) {
		MeetingContent meetingContent;
		if (id != null) {
			meetingContent = currentService.findById(id);
			WebUtil.getRequest().setAttribute("obj", meetingContent);
		}
		return "admin/meetingContent-form";
	}
   	
   	
   	/**
	 * 删除
	 */  
 	@RequestMapping(value = "/del")
	public @ResponseBody AjaxResult del(String keys) {
		return remove(currentService, keys);
	}
  
}